﻿<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" CodeBehind="TaskList.aspx.cs" Inherits="WMS6.Web.TaskMgmt.TaskList" meta:resourcekey="Page" %>
<%@ PreviousPageType VirtualPath="~/TaskMgmt/TaskQuery.aspx" %>
<%@ Register src="../UserControls/Pager.ascx" tagname="Pager" tagprefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>TaskList</title>
    <link href="../style/zh/1/css.css" type="text/css" rel="Stylesheet" id="mycss" />
    <link href="../Css/style.css" type="text/css" rel="stylesheet" />
    <script src="../Js/jquery.js" type="text/javascript"></script>
    <script src="../Js/jquery.simplemodal.js" type="text/javascript"></script> 
    <script src="../Js/checkbox.js" type="text/javascript"></script>
    <script src="../Js/util.js" type="text/javascript"></script>
    <script src="../Js/InitPage.js" type="text/javascript"></script>    
    <script type="text/javascript">
        //初始化页面
        window.onload = function(){
            initListPage();
        }
        
        function returnSearch()
        {
            var from = document.getElementById("hdnFrom").value;
            if(from != "")
            {
                window.location.href = "TaskQuery.aspx";
            }
            else
            {
                window.history.go(-1);
            }
        }
        
        function confirmMsg(code)
        {
            if(code == "C001")
            {
                if(confirm('<%=GetGlobalMsgResource("C001") %>'))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }

        }
        
    </script>
</head>
<body>
    <form id="F6012" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
           <asp:UpdatePanel ID="up1" runat="server">
            <ContentTemplate>
        <div id="div_List_top">
            <table>
                <tr>
                    <td valign="bottom"><asp:Label ID="lblUom" runat="server" CssClass="label_header" Text="任务列表" meta:resourcekey="lblUom"></asp:Label></td>
                    <td><asp:Button ID="btnNew" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnNew%>" OnClientClick="javascript:window.location.href='Task.aspx?from=list';return false;" /></td>
                    <td><asp:Button ID="btnEdit" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnEdit%>"  onclick="btnEdit_Click" /></td>
                    <td><asp:Button ID="btnDelete" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnDelete%>" OnClientClick="javascript:if(confirmMsg('C001')) return true; else return false;" onclick="btnDelete_Click" /></td>
                    <td><asp:Button ID="btnRefurbish" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnRefurbish%>" /></td>                   
                </tr>
            </table>
        </div>
        <div class="blank8">
        </div>
                
                <div id="div_List">
                <div id="div_List_msg">
                        <asp:Label ID="lblMsg" runat="server" CssClass="label_message"></asp:Label>
                    </div>
                    <asp:GridView ID="gvTask" runat="server" AutoGenerateColumns="False" 
                        AllowSorting="True" CssClass="gridview" onrowdatabound="gvTask_RowDataBound" oninit="gvTask_Init" 
                        onsorting="gvTask_Sorting" DataKeyNames="TASK_DETAIL_ID,STATUS" PageSize="20" 
                        Width="1600px" meta:resourcekey="gvTask" >
                            <FooterStyle CssClass="GridViewFooterStyle" />
                            <RowStyle CssClass="GridViewRowStyle" />
                            <HeaderStyle CssClass="GridViewHeaderStyle" />
                            <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                            <Columns>                    
                                <asp:BoundField HeaderText="序号" FooterText="序号" 
                                    meta:resourcekey="BoundField" ><ItemStyle CssClass="GridViewRowWidth_40" /></asp:BoundField>
                                <asp:TemplateField meta:resourcekey="TemplateField" >
                                    <HeaderTemplate>
                                        <asp:CheckBox ID="CheckBox1" runat="server"  
                                            onclick="selectAll(this,'gvTask');" meta:resourcekey="CheckBox1" /> 
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:CheckBox ID="chbSelect" runat="server" 
                                            meta:resourcekey="chbSelect"  />
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        <asp:CheckBox ID="CheckBox2" runat="server"   
                                            onclick="selectAll(this,'gvTask');" meta:resourcekey="CheckBox2" /> 
                                    </FooterTemplate>
                                    <HeaderStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_40"/>
                                    <ItemStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_40"/>
                                </asp:TemplateField> 
                                 <asp:TemplateField HeaderText="任务号" FooterText="任务号"   
                                    SortExpression="TASK_DETAIL_ID" meta:resourcekey="TASK_DETAIL_ID" >
                                    <ItemTemplate>
                                        <asp:HyperLink ID="HyperLink1" runat="server" Text='<%# Eval("TASK_DETAIL_ID") %>' 
                                            NavigateUrl='<%# FormatUrl("~/TaskMgmt/Task.aspx?from=list&ID={0}",Eval("TASK_DETAIL_ID").ToString()) %>' 
                                            Target="_self" CssClass="hyperlink" 
                                            meta:resourcekey="HyperLink1" ></asp:HyperLink>
                                    </ItemTemplate>
                                    <ItemStyle CssClass="GridViewRowWidth_150" />
                                </asp:TemplateField>                         
                                 <asp:BoundField DataField="TASK_TYPE_D" HeaderText="任务类型" FooterText="任务类型" 
                                    SortExpression="TASK_TYPE_D" meta:resourcekey="TASK_TYPE_D" ><ItemStyle CssClass="GridViewRowWidth_150" /></asp:BoundField>                                 
                                 <asp:BoundField DataField="STATUS_D" HeaderText="状态" FooterText="状态" 
                                    SortExpression="STATUS_D" meta:resourcekey="STATUS_D" ><ItemStyle CssClass="GridViewRowWidth_100" /></asp:BoundField>
                                     <asp:BoundField DataField="PRIORITY" HeaderText="优先级" FooterText="优先级"  
                                    SortExpression="PRIORITY" meta:resourcekey="PRIORITY"  ><ItemStyle CssClass="GridViewRowWidth_100" /></asp:BoundField>
                                 <asp:BoundField DataField="OWNER_ID" HeaderText="货主" FooterText="货主" 
                                    SortExpression="OWNER_ID" meta:resourcekey="OWNER_ID"  ><ItemStyle CssClass="GridViewRowWidth_150" /></asp:BoundField>
                                 <asp:BoundField DataField="SKU_ID" HeaderText="货品" FooterText="货品" 
                                    SortExpression="SKU_ID" meta:resourcekey="SKU_ID"  ><ItemStyle CssClass="GridViewRowWidth_150" /></asp:BoundField>
                                <asp:TemplateField FooterText="数量" HeaderText="数量" SortExpression="QTY" 
                                    meta:resourcekey="QTY">
                                    <ItemTemplate>
                                        <asp:Label ID="lblQTY" runat="server" 
                                            Text='<%# GetPreferenceDigit(Eval("QTY").ToString()) %>' 
                                            meta:resourcekey="lblQTY"></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                </asp:TemplateField>
                                 <asp:BoundField DataField="FROM_LOC" HeaderText="自货位" FooterText="自货位" 
                                    SortExpression="FROM_LOC" meta:resourcekey="FROM_LOC" ><ItemStyle CssClass="GridViewRowWidth_150" /></asp:BoundField>
                                 <asp:BoundField DataField="TO_LOC" HeaderText="至货位"  FooterText="至货位" 
                                    SortExpression="TO_LOC" meta:resourcekey="TO_LOC" ><ItemStyle CssClass="GridViewRowWidth_150" /></asp:BoundField>
                                 <asp:BoundField DataField="FROM_LPN_ID" HeaderText="自LPN" FooterText="自LPN" 
                                    SortExpression="FROM_LPN_ID" meta:resourcekey="FROM_LPN_ID" ><ItemStyle CssClass="GridViewRowWidth_150" /></asp:BoundField>
                                  <asp:BoundField DataField="TO_LPN_ID" HeaderText="至LPN" FooterText="至LPN" 
                                    SortExpression="TO_LPN_ID" meta:resourcekey="TO_LPN_ID" ><ItemStyle CssClass="GridViewRowWidth_150" /></asp:BoundField>
                                  <asp:BoundField DataField="USER_ID" HeaderText="用户" FooterText="用户" 
                                    SortExpression="USER_ID" meta:resourcekey="USER_ID" ><ItemStyle CssClass="GridViewRowWidth_100" /></asp:BoundField>
                                <asp:TemplateField FooterText="开始时间" HeaderText="开始时间" 
                                    SortExpression="START_TIME" meta:resourcekey="START_TIME">
                                    <ItemTemplate>
                                        <asp:Label ID="lblSTART_TIME" runat="server" 
                                            Text='<%# GetPreferenceShortDate(Eval("START_TIME").ToString()) %>' 
                                            meta:resourcekey="lblSTART_TIME"></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle CssClass="GridViewRowWidth_200" />
                                </asp:TemplateField>
                                   <asp:TemplateField FooterText="结束时间" HeaderText="结束时间" 
                                    SortExpression="END_TIME" meta:resourcekey="END_TIME">
                                    <ItemTemplate>
                                        <asp:Label ID="lblEND_TIME" runat="server" 
                                            Text='<%# GetPreferenceShortDate(Eval("END_TIME").ToString()) %>' 
                                            meta:resourcekey="lblEND_TIME"></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle CssClass="GridViewRowWidth_200" />
                                </asp:TemplateField>
                                <asp:BoundField DataField="CREATED_BY" HeaderText="创建人" FooterText="创建人" 
                                    SortExpression="CREATED_BY" meta:resourcekey="CREATED_BY">
                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                </asp:BoundField>
                                     </Columns>
                    </asp:GridView>
                    </div>        
                    <div id="div_pager">
                        <uc1:Pager ID="PagerFooter" runat="server" OnFirst="btnFirst_Click" OnPrevious="btnPrevious_Click" OnNext="btnNext_Click" OnLast="btnLast_Click" OnGoTo="GoTo_Click"/>
                    </div>
            </ContentTemplate>
            <Triggers>
            
              <asp:AsyncPostBackTrigger ControlID="btnNew" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnEdit" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnDelete" EventName="Click" />          
            <asp:AsyncPostBackTrigger ControlID="btnList" EventName="Click" />
             <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
              <asp:AsyncPostBackTrigger ControlID="btnReSearch" EventName="Click" />
               <asp:AsyncPostBackTrigger ControlID="btnList" EventName="Click" />
                <%--<asp:AsyncPostBackTrigger ControlID="btnExport" EventName="Click" />--%>
        </Triggers>
        </asp:UpdatePanel>    
        
        <div id="div_List_bottom">
            <table>
                <tr>
                    <td>
                        <asp:Button ID="btnSearch" runat="server" Text="<%$Resources:ButtonResource,btnNewSearch%>" CssClass="button" 
                            OnClientClick="javascript:window.location.href='TaskQuery.aspx';return false;"  />
                    </td>
                    <td>
                        <asp:Button ID="btnReSearch" runat="server" Text="<%$Resources:ButtonResource,btnReSearch%>" CssClass="button" OnClientClick="javascript:returnSearch();return false;"  />
                    </td>
                    <td>
                        <asp:Button ID="btnList" runat="server" Text="<%$Resources:ButtonResource,btnList%>" CssClass="button" OnClick="btnList_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnExport" runat="server" Text="<%$Resources:ButtonResource,btnExport%>" CssClass="button" OnClick="btnExport_Click"  />
                    </td>
                </tr>
            </table>
        </div>      
    </div>
    <input type="hidden" id="hdnFrom" runat="server" />
    <input type="hidden" id="hdnActionID" runat="server" />
        
    </form>
</body>
</html>
